package common;

import java.rmi.RemoteException;
import java.util.Calendar;

import common.rmi.event.RemoteAuctionEvent;

public class AuctionEvent extends Event implements RemoteAuctionEvent{
	
	private static final long serialVersionUID = 1L;
	private long auctionID;
	
	public AuctionEvent(long auctionID,String type) throws RemoteException {
		super(type);
		this.auctionID=auctionID;
	}
	
	public long getAuctionID(){
		return this.auctionID;
	}

	@Override
	public String stringRep() throws RemoteException {
		Calendar time=Calendar.getInstance();
		time.setTimeInMillis(this.timestamp);
		return this.type+": "+time.getTime().toString()+" - AuctionID: "+auctionID;
	}
	
}
